<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="java.util.Collection"%>
<%@page import="com.hz.model.Service"%>
<%@page import="com.hz.control.ServiceControl"%>
<%@page import="java.util.Iterator"%>
<%@page import="com.hz.model.Activity"%>
<%@page import="com.hz.control.ActivityControl"%>
<%@page import="com.hz.util.ParamUtil"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../../../css/active.css"/>
<title>Insert title here</title>
</head>
<body>
<h1 class='title'>您在加入红烛志愿者协会后参与了以下活动</h1>
<form>
<fieldset>
<table class='add'>
<thead>
<tr>
<td>活动名称</td>
<td>活动时间</td>
<td>负责人</td>
<td>地点</td>
<td>服务时长(小时)</td>
</tr>  
</thead>
<%
        request.setCharacterEncoding("utf-8");
        int uid =ParamUtil.getInt(request,"uid", (Integer)session.getAttribute("userid"));
        Collection<Service> slist = ServiceControl.oneGetAllActivities(uid);
        Iterator<Service> it = slist.iterator();
        while(it.hasNext()){
            Service s = it.next();
            Activity a = ActivityControl.getActivityInformation(s.getActId());   
%>
<tbody>
<tr>
<td><%=a.getActName() %></td>
<td><%=a.getStartTime() %>--<%=a.getEndTime() %></td>
<td><%=a.getLeader() %></td>
<td><% out.print(a.getPlace().length()>=6? a.getPlace().substring(0,5) : a.getPlace()); %></td>
<td><%=s.getServicesHours() %></td>
</tr>  
  <%         
        }
 %>
 </tbody>
 </table>
</fieldset>
</form>
</body>
</html>